package pd.struct.statement;

/**
 * Represents a statement that asserts a value.
 *
 * An assertion statement is a special case because it will never have its own node in a script tree. It will only be a parameter for other statement types such as if-statements and assignment statements.
 *
 * @author Joshua Swank
 * @param <T> The type asserted by the statement.
 */
public class Assertion<T>
{
    private T value;

    /**
     * Initializes a new assertion statement that asserts a constant value of type T.
     *
     * @param value the object to be asserted by the statement.
     */
    public Assertion( T value )
    {
        this.value = value;
    }

    /**
     * Returns the value asserted by the statement.
     *
     * @return the value asserted by the statement.
     */
    public T get()
    {
        return value;
    }
}
